/*
 * Copyright (c) 2019.11，华乘电气科技有限公司
 * All rights reserved.
 *
 * 文件名称：spectrumprivate.h
 * 
 * 初始版本：1.0
 * 作者：洪澄
 * 创建日期：2019/11/07
 * 摘要：图谱数据私有定义
 * 当前版本：1.0
 */

#pragma once

#include <QString>
#include "dataspecification_def.h"

namespace DataSpecificationGW
{
    struct SpectrumHeadPrivate
    {
        friend class Spectrum;

        quint8 ucSpectrumTypeCode;
        qint32 iSpectrumDataLength;
        QString qstrSpectrumGenerationTime;
        quint8 ucSpectrumCharacter;
        QString qstrEquipmentName;
        QString qstrEquipmentCode;
        QString qstrTestPointName;
        QString qstrTestPointCode;
        qint16 sDetectionChannelID;
        quint8 ucStorageDataType;

        void skipSpectrumTypeCode() { bSkipeSpectrumTypeCode = true; }
        void skipSpectrumDataLength() { bSkipSpectrumDataLength = true; }
        void skipSpectrumGenerationTime() { bSkipSpectrumGenerationTime = true; }
        void skipSpectrumCharacter() { bSkipSpectrumCharacter = true; }
        void skipEquipmentName() { bSkipEquipmentName = true; }
        void skipEquipmentCode() { bSkipEquipmentCode = true; }
        void skipTestPointName() { bSkipTestPointName = true; }
        void skipTestPointCode() { bSkipTestPointCode = true; }
        void skipDetectionChannelID() { bSkipDetectionChannelID = true; }
        void skipStorageDataType() { bSkipStorageDataType = true; }

        bool haseSpectrumTypeCode() const { return bHaseSpectrumTypeCode; }
        bool hasSpectrumDataLength() const { return bHasSpectrumDataLength; }
        bool hasSpectrumGenerationTime() const { return bHasSpectrumGenerationTime; }
        bool hasSpectrumCharacter() const { return bHasSpectrumCharacter; }
        bool hasEquipmentName() const { return bHasEquipmentName; }
        bool hasEquipmentCode() const { return bHasEquipmentCode; }
        bool hasTestPointName() const { return bHasTestPointName; }
        bool hasTestPointCode() const { return bHasTestPointCode; }
        bool hasDetectionChannelID() const { return bHasDetectionChannelID; }
        bool hasStorageDataType() const { return bHasStorageDataType; }

        SpectrumHeadPrivate();
        SpectrumHeadPrivate& operator=(const SpectrumHeadPrivate& obj_val);
        bool operator==(const SpectrumHeadPrivate& obj_val) const;

    private:
        bool bSkipeSpectrumTypeCode;
        bool bSkipSpectrumDataLength;
        bool bSkipSpectrumGenerationTime;
        bool bSkipSpectrumCharacter;
        bool bSkipEquipmentName;
        bool bSkipEquipmentCode;
        bool bSkipTestPointName;
        bool bSkipTestPointCode;
        bool bSkipDetectionChannelID;
        bool bSkipStorageDataType;

        bool bHaseSpectrumTypeCode;
        bool bHasSpectrumDataLength;
        bool bHasSpectrumGenerationTime;
        bool bHasSpectrumCharacter;
        bool bHasEquipmentName;
        bool bHasEquipmentCode;
        bool bHasTestPointName;
        bool bHasTestPointCode;
        bool bHasDetectionChannelID;
        bool bHasStorageDataType;
    };

    class SpectrumPrivate
    {
    public:
        SpectrumPrivate()
            : m_eDataSpecificationVersion(DefaultDataSpecificationVersion)
        {

        }

        SpectrumHeadPrivate m_stSpectrumHeadPrivate;
        DataSpecificationVersion m_eDataSpecificationVersion;
    };
}
